package com.study.cloud.gateway.core.config;

import lombok.Data;

/**
 * @author wangwancheng
 * @create 2025/7/18 13:45
 */
@Data
public class Config {

    private int port = 8888;

    private String applicationName = "gateway";

    private String registryAddress = "127.0.0.1:8848";

    private String env = "dev";

    //netty 参数相关设置
    //boss线程数
    private int eventLoopGroupBossNum = 1;
    //worker线程数
    private int eventLoopGroupWorkerNum = Runtime.getRuntime().availableProcessors();
    //传递内容大小 64M
    private int maxContentLength = 64 * 1024 * 1024;
    //是否是单异步模式 默认单异步
    private boolean whenComplete = true;

    //Http async 参数选项
    private int httpConnectTimeout = 3 * 1000;
    //请求超时时间
    private int httpRequestTimeout = 3 * 1000;
    //客户端请求重试次数
    private int httpRetryTimes = 2;
    //客户端请求最大链接数
    private int httpMaxConnections = 10000;
    //客户端每个地址支持的最大连接数
    private int httpMaxConnectionsPerHost = 8000;
    //客户端空闲链接超时时间
    private int httpPoolConnectionIdleTimeout = 60 * 1000;
}
